<%--
    Document   : printcook
    Created on : Dec 12, 2011, 11:45:21 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT,Models.ThamSoHT_Model, Models.DauBep_Model, Models.MonAn_Model, Models.DonViTinh_Model, Models.TuyChon_Model"%>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'notice', 'msgchef', 'cheflist', 'cancel', 'save', 'order', 'food', 'foodlist', 'notes', 'sl', 'dvt' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String cancel = mdsts[0].getTenTS();
            String cheflist = mdsts[1].getTenTS();
            String dvt = mdsts[2].getTenTS();
            String food = mdsts[3].getTenTS();
            String foodlist = mdsts[4].getTenTS();
            String msgchef = mdsts[5].getTenTS();
            String notes = mdsts[6].getTenTS();
            String notice = mdsts[7].getTenTS();
            String order = mdsts[8].getTenTS();
            String save = mdsts[9].getTenTS();
            String sl = mdsts[10].getTenTS();

            String chefmsg = notice + "/" + msgchef;

            Vector v = (Vector) request.getAttribute("DSDauBep");
            String MaMA = (String) request.getAttribute("MaMA");
            String SL = (String) request.getAttribute("SL");
            String DVT = (String) request.getAttribute("DVT");
            String GC = (String) request.getAttribute("GC");
            String MaCTHDT = (String) request.getAttribute("MaCTHDT");
            
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/style.css" type="text/css" rel="stylesheet" />
        <title>JSP Page</title>
        <script type="text/javascript">
            function GetNhanVien(value){
                document.getElementById("manv").value = value;
            }
        </script>
    </head>
    <body style="">
        <form name="frmcook" id="frmcook" action="" method="Post" target="_blank">
        <div style=" font-weight: bold; font-size: 18px; color: #ec3d45;"><%=cheflist%></div><br />
            <%  for(int i=0; i < v.size(); i++){
                    Beans.NhanVien nv = (Beans.NhanVien) v.elementAt(i);%>
                    <div style=" width: 160px; float: left;"><input type="radio" name="nv" value="<%=nv.getMaNV()%>" onclick="GetNhanVien(this.value)" style=" margin-right: 10px; margin-left: 20px; margin-bottom: 5px;"><%=nv.getHoTen() %></div>
            <%  }%>
        <div class="cb"></div>
        <div style=" font-weight: bold; font-size: 18px; color: #ec3d45; margin-top: 20px;"><%=foodlist%></div><br />
        <div style=" max-height: 260px; overflow: auto; margin-left: 15px; width: 94%;">
        <table style=" width: 100%; ">
                <thead>
                <td style=" width: 10%; padding-left: 5px;"><%=order%></td>
                <td style=" width: 32%;"><%=food%></td>
                <td style=" width: 15%; "><%=dvt%></td>
                <td style=" width: 7%;"><%=sl%></td>
                <td style=" text-align: center;"><%=notes%></td>
                </thead>
                <tbody >
                    <%
                                String mamonan[] = MaMA.split(";");
                                String soluong[] = SL.split(";");
                                String donvitinh[] = DVT.split(";");
                                String ghichu[] = GC.split(";");
                                        for (int i = 0; i < mamonan.length; i++) {%>
                    <tr>
                        <td style=" padding-left: 10px;"><%=i + 1%></td>
                        <td><%=MonAn_Model.LayTenMA(Integer.parseInt(mamonan[i]), langid)%></td>
                        <td><%=DonViTinh_Model.LayTenDVT(Integer.parseInt(donvitinh[i]), langid)%></td>
                        <td><%=soluong[i]%></td>
                        <td><%=ghichu[i]%></td>
                    </tr>
                    <%  }%>
                    <tr>                    
                </tr>
                </tbody>
            </table>
            </div>
            <input type="hidden" id="manv" name="manv" value="">
            <input type="hidden" id="MaMA" name="MaMA" value="<%=MaMA%>">
            <input type="hidden" id="SL" name="SL" value="<%=SL%>">
            <input type="hidden" id="DVT" name="DVT" value="<%=DVT%>">
            <input type="hidden" id="GC" name="GC" value="<%=GC%>">
            <input type="hidden" id="MaCTHDT" name="MaCTHDT" value="<%=MaCTHDT%>">
            <a class="button"  onclick="PhanCongMA(this.name)" name="<%=chefmsg%>" href="#" style=" margin-top: 20px; margin-bottom: 5px; margin-left: 180px; float: left;"><%=save%></a>
            <a class="button" onclick="HuyPhanCongMA()" href="#" style=" margin-top: 20px; margin-bottom: 5px; margin-left: 30px; float: left;"><%=cancel%></a>
        </form>
    </body>
</html>
